package com.zzh.bc.db.converter;

import com.zzh.bc.db.ColumnDbType;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * @Date: 2021/5/24 13:42
 * @Email: zzh_hz@126.com
 * @QQ: 1299234582
 * @Author: zzh
 * @Description: 浮点类型
 */
public class FloatColumnConverter implements ColumnConverter<Float> {
    @Override
    public Float getFieldValue(final ResultSet cursor, int index) throws SQLException {
        return  cursor.getFloat(index);
    }

    @Override
    public Object fieldValue2DbValue(Float fieldValue) {
        return fieldValue;
    }

    @Override
    public ColumnDbType getColumnDbType() {
        return ColumnDbType.REAL;
    }
}
